/* eslint-disable */
import { coerce, number, any, string, object, Describe } from 'superstruct'

//自定义数字类型
export const CNumber = coerce(number(), string(), (value) => parseFloat(value)||0)
//自定义文字类型
export const CString = coerce(string(), any(), (value) => typeof value === 'undefined' ?undefined:String(value))

//默认列表类型
export type ListType = {
  page: number
  pageSize: number
}

export const ListType:Describe<ListType> = object({
	// 页码
	page: CNumber,
	// 每页条数
	pageSize: CNumber
})
